<?php 

$arr = [45,5,4,[54,3,2,3],4,3];     //


function jo($x){
	foreach ($x as $k => $v) {
		if (is_array($v)) {
			foreach ($v as $kk => $vv) {
				if ($vv%2==1) {
					$vv=$vv*2;
					$x[$k][$kk]=$vv;
				}
			}
		} else {
			if ($v%2==1) {
				$v=$v*2;
				$x[$k]=$v;
			}
		}
		
	}
	return $x;
};


$res = jo($arr);
var_dump($res);














 ?>